home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / xmm12.zip / XMS30.DOC < prev   
Text File  |  1992-07-05  |  40KB  |  1,129 lines

  1. eXtended Memory Specification (XMS), version 3.0
  2.  
  3.  
  4. January 1991
  5.  
  6.  
  7. Copyright (c) 1988, Microsoft Corporation, Lotus Development
  8. Corporation, Intel Corporation, and AST Research, Inc.
  9.  
  10. Microsoft Corporation
  11. Box 97017
  12.  
  13. One Microsoft Way
  14. Redmond, WA 98073
  15.  
  16. LOTUS (r)
  17. INTEL (r)
  18. MICROSOFT (r)
  19. AST (r) Research
  20.  
  21. This specification was jointly developed by Microsoft Corporation,
  22. Lotus Development Corporation, Intel Corporation,and AST Research,
  23. Inc. Although it has been released into the public domain and is not
  24. confidential or proprietary, the specification is still the copyright
  25. and property of Microsoft Corporation, Lotus Development Corporation,
  26. Intel Corporation, and AST Research, Inc.
  27.  
  28. Disclaimer of Warranty
  29.  
  30. MICROSOFT CORPORATION, LOTUS DEVELOPMENT CORPORATION, INTEL
  31. CORPORATION, AND AST RESEARCH, INC., EXCLUDE ANY AND ALL IMPLIED
  32. WARRANTIES, INCLUDING WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  33. PARTICULAR PURPOSE. NEITHER MICROSOFT NOR LOTUS NOR INTEL NOR AST
  34. RESEARCH MAKE ANY WARRANTY OF REPRESENTATION, EITHER EXPRESS OR
  35. IMPLIED, WITH RESPECT TO THIS SPECIFICATION, ITS QUALITY,
  36. PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
  37. NEITHER MICROSOFT NOR LOTUS NOR INTEL NOR AST RESEARCH SHALL HAVE ANY
  38. LIABILITY FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
  39. OUT OF OR RESULTING FROM THE USE OR MODIFICATION OF THIS
  40. SPECIFICATION.
  41.  
  42. This specification uses the following trademarks:
  43.  
  44. Intel is a registered trademark of Intel Corporation, Microsoft is a
  45. registered trademark of Microsoft Corporation, Lotus is a registered
  46. trademark of Lotus Development Corporation, and AST is a registered
  47. trademark of AST Research, Inc.
  48.  
  49.  
  50. Extended Memory Specification
  51.  
  52. The purpose of this document is to define the Extended Memory
  53. Specification (XMS) version 3.00 for MS-DOS. XMS allows DOS programs to
  54. utilize additional memory found in Intel's 80286 and 80386 based
  55. machines in a consistent, machine independent manner. With some
  56. restrictions, XMS adds almost 64K to the 640K which DOS programs can
  57. access directly. Depending on available hardware, XMS may provide even
  58. more memory to DOS programs. XMS also provides DOS programs with a
  59. standard method of storing data in extended memory.
  60.  
  61. To be considered fully XMS 3.0 compliant, all calls except those
  62. associated with UMB support must be implemented. UMB functions 10h, 11h
  63. and 12h are optional for XMS 3.0 and may return the Function Not
  64. Implemented error code, 80h.
  65.  
  66. DEFINITIONS:
  67.  
  68. Extended Memory:
  69.  
  70. Memory in 80286 and 80386 based machines which is located above the 1MB
  71. address boundary.
  72.  
  73. High Memory Area (HMA):
  74.  
  75. The first 64K of extended memory.  The High Memory Area is unique
  76. because code can be executed in it while in real mode. The HMA
  77. officially starts at FFFF:10h and ends at FFFF:FFFFh making it 64K-16
  78. bytes in length.
  79.  
  80. Upper Memory Blocks (UMBs):
  81.  
  82. Blocks of memory available on some 80x86 based machines which are
  83. located between DOS's 640K limit and the 1MB address boundary.  The
  84. number, size, and location of these blocks vary widely depending upon
  85. the types of hardware adapter cards installed in the machine.
  86.  
  87. Extended Memory Blocks (EMBs):
  88.  
  89. Blocks of extended memory located above the HMA which can only be used
  90. for data storage.
  91.  
  92. A20 Line:
  93.  
  94. The 21st address line of 80x86 CPUs.  Enabling the A20 line allows
  95. access to the HMA.
  96.  
  97. XMM:
  98.  
  99. An Extended Memory Manager.  A DOS device driver which implements XMS.
  100. XMMs are machine specific but allow programs to use extended memory in a
  101. machine-independent manner.
  102.  
  103. HIMEM.SYS:
  104.  
  105. The Extended Memory Manager currently being distributed by Microsoft.
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118. Extended Memory
  119. (Other EMBs could exist above 1088K (1MB+64K)
  120.  
  121.  
  122.  
  123. Top of Memory
  124. High Memory Area (HMA)
  125. 1088K
  126.  
  127.  
  128. Upper Memory Area
  129.  
  130.  
  131. 1024K
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. Conventional or DOS memory
  139.  
  140.  
  141.  
  142.  
  143.  
  144. 640K
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. 0K
  158.  
  159.  
  160. DRIVER INSTALLATION:
  161.  
  162. An XMS driver is installed by including a DEVICE= statement in the
  163. machine's CONFIG.SYS file.It must be installed prior to any other
  164. devices or TSRs which use it.  An optional parameter after the driver's
  165. name (suggested name "/HMAMIN=") indicates the minimum amount of space
  166. in the HMA a program can use.  Programs which use less than the minimum
  167. will not be placed in the HMA.  See "Prioritizing HMA Usage" below for
  168. more information.  A second optional parameter (suggested name
  169. "/NUMHANDLES=") allows users to specify the maximum number of extended
  170. memory blocks which may be allocated at any time.
  171.  
  172. NOTE: XMS requires DOS 3.00 or above.
  173.  
  174.  
  175. THE PROGRAMMING API:
  176.  
  177. The XMS API Functions are accessed via the XMS driver's Control
  178. Function. The address of the Control Function is determined via INT 2Fh.
  179. First, a program should determine if an XMS driver is installed.  Next,
  180. it should retrieve the address of the driver's Control Function.  It can
  181. then use any of the available XMS functions.  The functions are divided
  182. into several groups:
  183.  
  184. 1. Driver Information Functions (0h)
  185. 2. HMA Management Functions (1h-2h)
  186. 3. A20 Management Functions (3h-7h)
  187. 4. Extended Memory Management Functions (8h-Fh)
  188. 5. Upper Memory Management Functions (10h-11h)
  189.  
  190.  
  191. DETERMINING IF AN XMS DRIVER IS INSTALLED:
  192.  
  193. The recommended way of determining if an XMS driver is installed is to
  194. set AH=43h and AL=00h and then execute INT 2Fh.  If an XMS driver is
  195. available, 80h will be returned in AL.
  196.  
  197. Example:
  198.  
  199. ; Is an XMS driver installed?
  200. mov     ax,4300h
  201. int     2Fh         
  202. cmp     al,80h  
  203. jne     NoXMSDriver
  204.  
  205.  
  206. CALLING THE API FUNCTIONS:
  207.  
  208. Programs can execute INT 2Fh with AH=43h and AL=10h to obtain the
  209. address of the driver's control function.  The address is returned in
  210. ES:BX.  This function is called to access all of the XMS functions.  It
  211. should be called with AH set to the number of the API function
  212. requested.  The API function will put a success code of 0001h or 0000h
  213. in AX.  If the function succeeded (AX=0001h), additional information may
  214. be passed back in BX and DX.  If the function failed (AX=0000h), an
  215. error code may be returned in BL.  Valid error codes have their high bit
  216. set.  Developers should keep in mind that some of the XMS API functions
  217. may not be implemented by all drivers and will return failure in all
  218. cases.
  219.  
  220. Example:
  221.  
  222. ; Get the address of the driver's control function
  223. mov     ax,4310h
  224. int     2Fh
  225. mov     word ptr [XMSControl],bx        ; XMSControl is a DWORD
  226. mov     word ptr [XMSControl+2],es
  227.            
  228. ; Get the XMS driver's version number
  229. mov     ah,00h
  230. call    [XMSControl]    ; Get XMS Version Number
  231.  
  232. NOTE: Programs should make sure that at least 256 bytes of stack space
  233. is available before calling XMS API functions.
  234.  
  235.  
  236. API FUNCTION DESCRIPTIONS:
  237.  
  238. The following XMS API functions are available:
  239.  
  240. 0h)  Get XMS Version Number
  241. 1h)  Request High Memory Area
  242. 2h)  Release High Memory Area
  243. 3h)  Global Enable A20
  244. 4h)  Global Disable A20
  245. 5h)  Local Enable A20
  246. 6h)  Local Disable A20
  247. 7h)  Query A20
  248. 8h)  Query Free Extended Memory
  249. 9h)  Allocate Extended Memory Block
  250. Ah)  Free Extended Memory Block
  251. Bh)  Move Extended Memory Block
  252. Ch)  Lock Extended Memory Block
  253. Dh)  Unlock Extended Memory Block
  254. Eh)  Get Handle Information
  255. Fh)  Reallocate Extended Memory Block
  256. 10h)  Request Upper Memory Block
  257. 11h)  Release Upper Memory Block
  258. 12h) Realloc Upper Memory Block
  259. 88h) Query any Free Extended Memory
  260. 89h) Allocate any Extended Memory Block
  261. 8Eh) Get Extended EMB Handle
  262. 8Fh) Realloc any Extended Memory
  263.  
  264. Each is described below.
  265.  
  266.  
  267. Get XMS Version Number (Function 00h):
  268.  
  269.     ARGS:    AH = 00h
  270.     RETS:    AX = XMS version number
  271.         BX = Driver internal revision number
  272.         DX = 0001h if the HMA exists, 0000h otherwise
  273.     ERRS:    None
  274.  
  275. This function returns with AX equal to a 16-bit BCD number representing
  276. the revision of the DOS Extended Memory Specification which the driver
  277. implements (e.g. AX=0235h would mean that the driver implemented XMS
  278. version 2.35). BX is set equal to the driver's internal revision number
  279. mainly for debugging purposes.  DX indicates